﻿<%@ page language="C#" autoeventwireup="true" inherits="Databases, MainSite" enablesessionstate="True" masterpagefile="~/Site.Master" %>


<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="BodyContent">


    <form id="Form1" runat="server">
        <div class="contentfull">
            <div class="breadcrumbs">
                <ul id="crumbs">
                    <li><a title="My Account" href="/account/">My Account</a>
                        <img src="Content/Images/separator.png" alt="&rarr;" class="separator">
                        Databases
                    </li>
                </ul>
            </div>

           <div id="showMessages" runat="server" visible="false">
            <div class='success'>
                <p></p>
                <li>
                    <span id="mmsg" runat="server"></span>
                </li>
                <p></p>
            </div>
        </div>


            <div class="top">
                <div class="innerright">
                    <a href="CreateDatabase.aspx" class="black_button bhuge" title="Create a Service">Create a Database</a>
                    <div class="need-help"><a href="HowTo/database.html" target="_blank">Need help creating a Database?</a></div>

                </div>

                <div class="innerleft">
                    <h1>Databases</h1>
                    <div class="lower_comment">
                        Order By:  
                    
                    <a href="Databases.aspx?order=time" style="font-weight: lighter; color: #999" id="dateSorter" runat="server">Creation Date</a>
                    <a href="Databases.aspx?order=alpha" style="font-weight: lighter; color: #999;" id="nameSorter" runat="server">Name</a>
                    <a href="Databases.aspx?order=service" style="font-weight: lighter; color: #999;" id="serviceSorter" runat="server">Number of Services</a>
                        &nbsp;&nbsp;&nbsp;Show: 
					<a href="?show=all&order=time">All</a>
                    </div>
                </div>
                <div class="pagination">
                    <div class="scancount large center" id="dbCount" runat="server"></div>
                    <ul id="paginator1"></ul>
                </div>
            </div>
            <div class="content">
                <asp:ListView ID="databasesList" runat="server" ItemPlaceholderID="itemContainer">
                    <LayoutTemplate>
                        <ul class="data">
                            <asp:PlaceHolder ID="itemContainer" runat="server"></asp:PlaceHolder>
                        </ul>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <li class="group">
                            <p class="data_action">
                                <a href="ViewDatabase/DatabaseExportBarcodes.aspx" title="Export Barcodes">Export Barcodes</a>
                                <a href="DatabaseSearch.aspx?dbid=<%#Eval("DbId")%>&mode=Edit" title="View Database">Edit</a>
                                <a href="DeleteDatabase.aspx?dbid=<%#Eval("DbId")%>" class="a_delete_database">Delete</a>
                            </p>
                            <img src="<%# this.GetDBImage(Eval("RowCount").ToString()) %>" class="dataicon" alt="Database"><h1>
                                <a href="DatabaseSearch.aspx?dbid=<%#Eval("DbId")%>&mode=Edit" title="View Database"><%#Eval("DBName")%></a></h1>
                            <h2><%# this.GetRowCount(Eval("RowCount").ToString()) %></h2>
                            <dl class="meta group">
                                <dt>
                                    <img src="Images/time16.png" class="attr" alt="Date Updated"></dt>
                                <dd>Updated on <%#Eval("LastUpdated","{0:MMM d, yyyy hh:mm tt}")%></dd>
                                <%# this.GetCaseSensitiveValidation(Eval("IsCaseSensitiveValidation").ToString()) %>
                                <dt>
                                    <img src="Images/service16.png" class="attr" alt="The database is associated with these services:"></dt>
                                <dd title="The database is associated with these services.">
                                <%# this.GetServiceCount(Eval("DbId").ToString()) %>   
                                </dd>
                            </dl>
                        </li>
                    </ItemTemplate>
                    <EmptyDataTemplate>
                        <div>
                            Sorry - No Databases Found
                        </div>
                    </EmptyDataTemplate>
                </asp:ListView>
                <script type="text/javascript">
                    $(document).ready(function () {
                        $("a.a_delete_database").click(function (event) {
                            return confirm('Are you sure you want to delete this database? You will not be able to undo this action. Note the database can only be deleted if it is not linked to any service.');
                        });

                        // check out codereadr.js, this sets up Jquery stuff for hiding and showing services.
                        setupClickToShowService();

                    });
		</script>
                <div class="pagination">
                    <!--<ul id="paginator2"></ul>-->

                </div>

            </div>
        </div>
        <!-- .contentfull -->

        <!-- .wrapper -->
        <input type="hidden" id="HidSort" runat="server" />
        <input type="hidden" id="HidOrder" runat="server" />
    </form>

</asp:Content>
